package com.yb.domain.goods;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.yb.base.annotation.Column;
import com.yb.base.annotation.Table;
import com.yb.base.entity.BaseEntity;
import com.yb.util.comm.DateTimeUtil;

import freemarker.template.SimpleDate;

/*
 * 拼购申请表
 */

@Table("t_p_buy_record")
public class TpBuyRecord extends BaseEntity {
	private String name;
	private String pho;
	private String tel;
	private String address;
	private String buyNum;
	private String proName;
	private String model;
	private String price;
	private String total;
	private String zhekou;
	private Date queryDate;
	@Column(name = "reject")
	private String queryDateStr;
	private String autding;
	private Date partTime;
	private Date createTime;
	private int brandId;
	@Column(name = "reject")
	private String partTimeStr;
	@Column(name = "reject")
	private String createTimeStr;
	private int categoryId;
	private int typeId;
	private int userId;
	private int modifyTimes;
	
	@Column(name = "reject")
	private String sex;
	
	@Column(name = "reject")
	private String showName;

	@Column(name = "reject")
	private String partTimeFormat;

	@Column(name = "reject")
	    private String brandName;
	
	@Column(name = "reject")
    private String partTime2;
	
	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	public int getTypeId() {
		return typeId;
	}

	public void setTypeId(int typeId) {
		this.typeId = typeId;
	}

	public Date getPartTime() {
		return partTime;
	}

	public void setPartTime(Date partTime) {
		this.partTime = partTime;
	}

	public String getAutding() {
		return autding;
	}

	public void setAutding(String autding) {
		this.autding = autding;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPho() {
		return pho;
	}

	public void setPho(String pho) {
		this.pho = pho;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getBuyNum() {
		return buyNum;
	}

	public void setBuyNum(String buyNum) {
		this.buyNum = buyNum;
	}

	public String getProName() {
		return proName;
	}

	public void setProName(String proName) {
		this.proName = proName;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public String getTotal() {
		return total;
	}

	public void setTotal(String total) {
		this.total = total;
	}

	public String getZhekou() {
		return zhekou;
	}

	public void setZhekou(String zhekou) {
		this.zhekou = zhekou;
	}

	public Date getQueryDate() {
		return queryDate;
	}

	public void setQueryDate(Date queryDate) {
		this.queryDate = queryDate;
	}

	public String getQueryDateStr() {
		return queryDateStr;
	}

	public void setQueryDateStr(String queryDateStr) {
		this.queryDateStr = queryDateStr;
	}

	public int getBrandId() {
		return brandId;
	}

	public void setBrandId(int brandId) {
		this.brandId = brandId;
	}

	public String getPartTimeStr() {
		return partTimeStr;
	}

	public void setPartTimeStr(String partTimeStr) {
		this.partTimeStr = partTimeStr;
	}

	public String getPartTimeFormat() {
		if (null != partTime) {
			partTimeFormat = new SimpleDateFormat("yyyy年MM月").format(partTime);
		}
		return partTimeFormat;
	}

	public void setPartTimeFormat(String partTimeFormat) {
		this.partTimeFormat = partTimeFormat;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getShowName() {
		String temp = "先生";
		if(null != sex){
			if("2".equals(sex))
				temp = "女士";
		}
		if(null == name || "".equals(name))
			name = "测试";
		if(name.indexOf(" ")!=-1){
			showName = name.substring(0, name.indexOf(" "))+temp;
		}else{
			showName = name.substring(0,1)+temp;
		}
		return showName;
	}

	public void setShowName(String showName) {
		this.showName = showName;
	}

	public Date getCreateTime() {
		return createTime;
	}
	
	public String getCreateTimeString() {
		if(null != createTime){
			return DateTimeUtil.getDateToString(createTime, "yyyy-MM-dd HH:mm:ss");
		}
		return "";
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreateTimeStr() {
		return createTimeStr;
	}

	public void setCreateTimeStr(String createTimeStr) {
		this.createTimeStr = createTimeStr;
	}

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

	public int getModifyTimes() {
		return modifyTimes;
	}

	public void setModifyTimes(int modifyTimes) {
		this.modifyTimes = modifyTimes;
	}

    public String getPartTime2() {
        return partTime2;
    }

    public void setPartTime2(String partTime2) {
        this.partTime2 = partTime2;
    }


}
